/*******************************************************************************
 * Licensed Materials - Property of IBM
 * (c) Copyright IBM Corporation 2005, 2008. All Rights Reserved. 
 * 
 * Note to U.S. Government Users Restricted Rights:  Use, 
 * duplication or disclosure restricted by GSA ADP Schedule 
 * Contract with IBM Corp.
 *******************************************************************************/

package org.eclipsecon.dui.interpreter.internal;

import org.eclipse.jface.action.Action;

public class ReloadAction extends Action {
	private final ModelContainer fModelContainer;

	public ReloadAction(ModelContainer modelContainer) {
		super("Reload", Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/reload.gif"));
		fModelContainer= modelContainer;
	}

	/*
	 * @see org.eclipse.jface.action.Action#run()
	 */
	@Override
	public void run() {
		if (fModelContainer.getModelPath() != null)
			new ReloadJob(fModelContainer, fModelContainer.getModelPath(), fModelContainer.getScript()).schedule();
	}
}